package com.atguigu.tingshu.search.api;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.search.service.ItemService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "专辑详情管理")
@RestController
@RequestMapping("/api/search/albumInfo")
public class itemApiController {

    private final ItemService itemService;

    @Autowired
    public itemApiController(ItemService itemService) {
        this.itemService = itemService;
    }

    @GetMapping("/test")
    public Result test() {
        for (long i = 1; i < 2000; i++) {
            itemService.albumFromMysqlToEs(i);
        }
        return Result.ok();
    }
}

